﻿namespace Ganss.Excel.Tests.Data
{
    class ProductDirection
    {
        [Column(MappingDirections.ExcelToObject)]
        public string Name { get; set; }

        [Column("Number", MappingDirections.ExcelToObject)]
        public int NumberInStock { get; set; }

        [Column(MappingDirections.ObjectToExcel)]
        public decimal Price { get; set; }

        [Column(MappingDirections.ObjectToExcel)]
        public string Value { get; set; }

        public override bool Equals(object obj) =>
            obj is ProductDirection o
            && o.Name == Name
            && o.NumberInStock == NumberInStock
            && o.Price == Price
            && o.Value == Value;

        public override int GetHashCode() =>
            $"{Name}{NumberInStock}{Price}{Value}".GetHashCode();
    }
}